!function(e,t,n){"use strict";var a=window.dataLayer||[],d=function(t){var n;if("string"==typeof t)n=t;else{if(!e(t).length)return"";n=e(t).text()}return n.replace(/\n/g,"").trim()};n.behaviors.npProductDetailPage={attach:function(n){t("np-pdp-full-gtm-once",".node--type-dsu-product.node--view-mode-full",n).forEach((function(t){e(t).find(".product-buttons").find(".field--name-field-product-contact-rep > a, .field--name-field-product-promotion-link > a, .field--name-field-distributor > div").each((function(t,n){const i=URL.parse(e(n).prop("href"));e(n).attr("id")||e(n).attr("id",`pdp-button-${t}`),e(n).on("click",(function(t){a.push({event:"cta_click",event_name:"cta_click",link_classes:e(n).attr("class"),link_domain:i?i.hostname:window.location.hostname,link_id:e(n).attr("id"),link_text:d(n),link_url:e(n).prop("href")||window.location.href})}))}))}));t("np-pdp-gtm-thumbnail-gallery-once",".product-main-gallery-thumbnail",n).forEach((function(t){const n=e(t),i=n.closest(".node--type-dsu-product.node--view-mode-full");n.find("img, .field--name-field-media-video-file").each((function(t,n){e(n).on("click",(function(n){a.push({event:"product_carousel_click",event_name:"product_carousel_click",item_id:d(e(".field--name-field-nestle-product-code",i)),item_name:d(e("h1.field--name-field-formatted-headline",i)),item_brand:i.data("product-brand"),item_category:i.data("product-category"),item_subcategory:i.data("product-subcategory"),index:`${t+1}`})}))}))}));t("np-pdp-gtm-gallery-once",".product-main-gallery",n).forEach((function(t){const n=e(t),i=n.closest(".node--type-dsu-product.node--view-mode-full");n.find(".field--name-field-media-image, .field--name-field-media-video-file").each((function(t,n){e(n).hasClass("field--name-field-media-video-file")&&e(n).find("video").on("play",(function(n){a.push({event:"product_carousel_video_play",event_name:"product_carousel_video_play",item_id:d(e(".field--name-field-nestle-product-code",i)),item_name:d(e("h1.field--name-field-formatted-headline",i)),item_brand:i.data("product-brand"),item_category:i.data("product-category"),item_subcategory:i.data("product-subcategory"),index:`${t+1}`})}))}))}));t("np-pdp-gtm-tabs-once",".paragraph-np-tabs",n).forEach((function(t){const n=e(t),i=n.closest(".node--type-dsu-product.node--view-mode-full");n.find(".nav-tabs li a").each((function(t,n){e(n).on("click",(function(t){a.push({event:"pdp_tab_click",event_name:"pdp_tab_click",tab_name:d(n),item_id:d(e(".field--name-field-nestle-product-code",i)),item_name:d(e("h1.field--name-field-formatted-headline",i)),item_brand:i.data("product-brand"),item_category:i.data("product-category"),item_subcategory:i.data("product-subcategory")})}))}))}))}}}(jQuery,once,Drupal);